- Title
- Leveraging Stack Overflow to Detect Relevant Tutorial Fragments of APIs
- Creator
- Wu, Di; Jing, Xiao-Yuan; Zhang, Hongyu; Zhou, Yuming; Xu, Baowen
- Relation
- 2021 IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2021. Proceedings of 2021 IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2021 (Honolulu, HI 09-12 March, 2021) p. 119-130
- Publisher Link
- http://dx.doi.org/10.1109/SANER50967.2021.00020
- Publisher
- Institute of Electrical and Electronics Engineers (IEEE)
- Resource Type
- conference paper
- Date
- 2021
- Description
- Developers often use learning resources such as API tutorials and Stack Overflow (SO) to learn how to use an unfamiliar API. An API tutorial can be divided into a number of consecutive units that describe the same topic, denoted as tutorial fragments. We consider a tutorial fragment explaining the API usage knowledge as a relevant fragment of the API. Discovering relevant tutorial fragments of APIs can facilitate API understanding and learning. However, existing approaches, based on supervised or unsupervised approaches, often suffer from either high manual efforts or lack of consideration of the relevance information. In this paper, we propose a novel approach, called SO2RT, to detect relevant tutorial fragments of APIs based on SO posts. SO2RT first automatically extracts relevant and irrelevant
pairs based on heuristic rules of SO, and constructs pairs (FRA stands out fragment) by using tutorial fragments and APIs. SO2RT then trains a semi-supervised transfer learning based detection model, which can transfer the API usage knowledge in SO QA pairs to tutorial fragments by utilizing the easy-to-extract relevance of pairs. Finally, relevant fragments of APIs can be discovered by consulting the trained model. In this way, the effort for labeling the relevance between tutorial fragments and APIs can be reduced. We evaluate SO2RT on Java and Android datasets containing 21, 008 pairs. Experimental results show that SO2RT improves the state-of-the-art approaches in terms of F-Measure on both datasets. Our user study further confirms the effectiveness of SO2RT in practice. - Subject
- application programming interfaces; stack overflow; tutorial fragments; APIs
- Identifier
- http://hdl.handle.net/1959.13/1472075
- Identifier
- uon:48757
- Identifier
- ISBN:9781728196305
- Language
- eng
- Reviewed
- Hits: 856
- Visitors: 853
- Downloads: 0